#include "lib_for_lua.h"
#include <iostream>

using namespace std;

int lua_http_version_detect(lua_State *L, char *url)
{
  int result;

  /* the function name */
  lua_getglobal(L, "luamain");

  /* the first argument */
  lua_pushstring(L, url);
  lua_call(L, 1, 1);

  /* get the result */
  result = (int)lua_tonumber(L, -1);
  lua_pop(L, 1);

  return result;
}
